package com.example.hello.client.Container;

import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.Connector;

import java.util.LinkedList;
import java.util.List;

public class BootstrapContainerState extends AbstractComponentState {

    private List<Connector> widgets = new LinkedList<Connector>();

    public List<Connector> getWidgets() {
        return widgets;
    }

    public void setWidgets(List<Connector> widgets) {
        this.widgets = widgets;
    }

    public void addWidget(Connector widget) {
        addWidget(widget, widgets.size());
    }

    public void addWidget(Connector widget, int index) {
        widgets.add(index, widget);
    }

    public boolean removeWidget(Connector widget) {
        return widgets.remove(widget);
    }

}
